package com.fixme4trade.persistence;

import javax.inject.Inject;
import javax.persistence.EntityManager;
import org.slf4j.Logger;
import com.fixme4trade.constant.Role;
import com.fixme4trade.domain.Customer;
import com.fixme4trade.domain.User;
import br.gov.frameworkdemoiselle.stereotype.PersistenceController;
import br.gov.frameworkdemoiselle.template.JPACrud;
import br.gov.frameworkdemoiselle.transaction.Transactional;

@PersistenceController
public class CustomerDAO extends JPACrud<Customer, Long> {
	
	private static final long serialVersionUID = 1L;

	@Inject
	@SuppressWarnings("unused")
	private Logger logger;
	
	@Inject
	private EntityManager em;
	
	@Inject
	private UserDAO userDAO;
	
	/*
	@Transactional
	public void activateCustomerAccount(User user) {
		Customer customer = new Customer();
		customer.setUser(user);
		
		user.getRoleList().add(Role.CUSTOMER);
		
		userDAO.update(user);						
		this.insert(customer);
	}
	*/
}
